/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */
package com.myapp.struts.Social.ReportMessage;
import com.myapp.struts.Social.DeleteMessage.*;

import com.myapp.model.mensajes.Mensajes;
import com.myapp.svc.Social.SocialSvc;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
import org.apache.struts.action.ActionForm;
import org.apache.struts.action.ActionForward;
import org.apache.struts.action.ActionMapping;

public class ReportMessageAction extends org.apache.struts.action.Action {

    /* forward name="success" path="" */
    private static final String SUCCESS = "success";

    @Override
    public ActionForward execute(ActionMapping mapping, ActionForm form,
            HttpServletRequest request, HttpServletResponse response)
            throws Exception {
        Mensajes m = new Mensajes();
        m.setIdmensaje(Integer.parseInt(request.getParameter("idmensaje")));
        SocialSvc ssvc = new SocialSvc();
        ssvc.reportMessage(m);
        return mapping.findForward(SUCCESS);
    }
}
